#include <iostream>
#include "logger.h"
#include "tcp_server.h"
#include "protocol/command.h"
#include "protocol/codec.h"


int main(int argc, char** argv)
{
	CLogger::init("log4cplus.properties");
	TcpServer server("8800");
	server.Start();

	CmdHead head;
	head.magic_number = kMagicNum;
	head.version = 13;
	head.body_length = 124;
	head.flag = 1;
	head.service_id = 14;
	head.cmd_name = "GetReward";
	std::cout << head.str() << endl;
	std::string buffer;
	EncodeHead(head, buffer);
	CmdHead header;
	DecodeHead(buffer, header);
	std::cout << header.str() << endl;

	return 0;
}
